# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=pix
pkgver=2.1.2
pkgrel=0
_geonames_pkgver=2020.06.25
pkgdesc="Image gallery manager built with MauiKit"
# armhf blocked by qt5-qtdeclarative
# s390x and riscv64 blocked by mauikit
arch="all !armhf !s390x !riscv64"
url="https://invent.kde.org/maui/pix"
license="GPL-3.0-or-later"
depends="
	kquickimageeditor
	qt5-qtbase-sqlite
	"
makedepends="
	attica-dev
	exiv2-dev
	extra-cmake-modules
	kconfig-dev
	ki18n-dev
	kio-dev
	knotifications-dev
	mauikit-dev
	mauikit-filebrowsing-dev
	mauikit-imagetools-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtlocation-dev
	qt5-qtsvg-dev
	samurai
	"
source="https://download.kde.org/stable/maui/pix/$pkgver/pix-$pkgver.tar.xz
	https://github.com/pmsourcedump/geonames/archive/$_geonames_pkgver/geonames-$_geonames_pkgver.tar.gz
	"
options="!check" # No tests available

prepare() {
	default_prepare

	unzip "$srcdir/geonames-$_geonames_pkgver"/cities1000.zip
}

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	mv "$builddir"/cities1000.txt build/src/
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
71b335424db3d6388c91ed275b652207aa72dada19a8104e7684569ade07c774fee44ad047608eff5991d511f9703d421b6dac906dc2009e5887b9a09fc7fa9c  pix-2.1.2.tar.xz
07485983a5ce0f03f1e12e64c280abe01e81beaa22b2dd43bc1b0e7632298acbfb83f09ef8c01a0915481c8e918a430b97d68f1ed5d43f76506798245345bc14  geonames-2020.06.25.tar.gz
"
